<include file="Common/works/header" />
<include file="Common/works/left_menu" />
<link href="__PUBLIC__/home/css/bootstrap.min.css" rel="stylesheet" />
<link href="__PUBLIC__/home/css/uploads_pic/cropper.min.css" rel="stylesheet" />
<link href="__PUBLIC__/home/css/uploads_pic/main.css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/home/css/waitMe.css" />

<div class="right" method="post" id="tab1" name="tab1">
	<div class="faservice_title">
		<a href="/apiworks/index" title="我的服务">我的服务</a>&nbsp;&gt;&nbsp;添加服务
	</div>
	<div class="faservice">
		<div class="column">
			<div class="field">服务名称:</div>
			<input name="service_name" id="service_name" class="kt1 fl _service_name _blur_rz" opt-tip="请输入服务名称" placeholder="请填写中文名称，长度不超过10个字" />
			<div id="service_name_id" class="error hide">
				<i></i><span id="service_name_msg"></span>
			</div>
		</div>
		<div class="column">
			<div class="field">英文名称:</div>
			<input name="service_name_en" id="service_name_en" class="kt1 fl _service_name_en _blur_rz" opt-tip="请输入服务英文名称" autocomplete="on" placeholder="长度不超过30字符" />
			<div class="commentaryt">&nbsp;&nbsp;1-30位英文、数字、下划线(必须以英文开头)</div>
			<div id="service_name_en_id" class="error hide">
				<i></i><span id="service_name_en_msg"></span>
			</div>
			<div class="cls"></div>
		</div>
		<div class="column">
			<div class="fieldd">
				用于生成云途数据的API地址： https://api.37degree.com/open/<span style="color: #1080f2">service_name</span>/api_name 保存后不能修改
			</div>
		</div>

		<div class="cls"></div>
		<div class="column">
			<div class="field">服务介绍:</div>
			<textarea name="service_introduction" id="service_introduction" class="textarea fl _service_introduction _blur_rz" maxlength="500" placeholder="请填写服务介绍，长度不超过500个字" opt-tip="请输入服务介绍" /></textarea>
			<div class="error hide" style="margin-top: 36px" id="service_introduction_id">
				<i></i><span id="service_introduction_msg"></span>
			</div>
			<div class="cls"></div>
		</div>

		<div class="column _serviceList">
			<div class="field">服务分类:</div>
			<select id="selected_category" class="class _selecte_category_list fl margin-right-15">
			</select>
			<!--9-6添加-->
			<div class="_secList">
				<select id="select-crumbs2" class="class _selecte_category_list fl">
				</select>
			</div>
			<!--添加end-->
			<div class="error hide" id="selected_category_id">
				<i></i><span id="selected_category_msg"></span>
			</div>
			<div class="cls"></div>
		</div>

		<div class="column">
			<div class="field">服务LOGO:</div>
			<div class="fl">
				<div id="crop-avatar">
					<!-- Current avatar -->
					<div class="avatar-view" title="图片上传">
						<img src="__PUBLIC__/home/images/scan.jpg" class="fl" alt="Avatar" />
						<input type="hidden" value="" class="_service_logo" />
					</div>

					<!-- Cropping modal -->
					<div class="modal fade" id="avatar-modal" aria-hidden="true" aria-labelledby="avatar-modal-label" role="dialog" tabindex="-1">
						<div class="modal-dialog modal-lg">
							<div class="modal-content">
								<form class="avatar-form" action="/common/imageUpload.html" enctype="multipart/form-data" method="post">
									<div class="modal-header">
										<button class="close" data-dismiss="modal" type="button">&times;</button>
										<h4 class="modal-title" id="avatar-modal-label">服务LOGO上传</h4>
									</div>
									<div class="modal-body">
										<div class="avatar-body">

											<!-- Upload image and data -->
											<div class="avatar-upload">
												<input class="avatar-src" name="avatar_src" type="hidden" />
												<input class="avatar-data" name="avatar_data" type="hidden" />
												<label for="avatarInput">图片选择</label>
												<input class="avatar-input" id="avatarInput" name="avatar_file" type="file" />
												<div class="avatar-upload-tip"></div>
											</div>

											<!-- Crop and preview -->
											<div class="row">
												<div class="col-sm-8">
													<div class="avatar-wrapper"></div>
												</div>
												<div class="col-sm-4 center-block">
													<div style="padding:0 15px;">

														<div class="avatar-preview preview-lg container" title="图片上传">
															<img src="__PUBLIC__/home/images/scan.jpg" />
														</div>
														<div class="avatar-preview preview-md container" title="图片上传">
															<img src="__PUBLIC__/home/images/scan.jpg" />
														</div>

														<div class="avatar-btns">
															<div class="col-md-11 container">
																<button class="btn btn-primary btn-block avatar-save" type="submit">完成</button>
															</div>
														</div>
													</div>
												</div>
											</div>

										</div>
									</div>
								</form>
							</div>
						</div>
					</div>
					<!-- /.modal -->

					<!-- Loading state -->
					<div class="loading" aria-label="Loading" role="img" tabindex="-1"></div>
				</div>
				<div class="upload">图片大小280*242px，不超过500k，格式仅支持jpg，png，gif</div>
			</div>
			<div class="error hide" id="file_upload_id" style="margin-top: 36px">
				<i></i><span id="file_upload_msg"></span>
			</div>
		</div>

		<div class="column">
			<div class="fieldt fl">请求协议:</div>
			<div class="classification">
				<input name="service_proto" class="xz _service_host_protol" type="radio" value="http" checked="checked" /> HTTP
			</div>
			<if condition="$user_email eq 'shipeng.hou@37degree.com'">
				<div class="classification">
					<input name="service_proto" class="xz _service_host_protol" type="radio" value="ice" /> ICE
				</div>
			</if>
			<div class="cls"></div>
		</div>

		<div class="column">
			<div class="field">服务域名:</div>
			<div class="slurl">
				<span id="protol_id">http</span>://<span><input name="service_host" id="service_host" class="kt7 _service_host _blur_rz" placeholder="www.37degree.com" opt-tip="请输入服务域名" autocomplete="on" /></span>
			</div>
			<div id="service_host_id" class="error hide">
				<i></i><span id="service_host_msg"></span>
			</div>
			<div class="cls"></div>
		</div>

		<div class="column">
			<div class="fieldd">例如: www.37degree.com,暂不支持HTTPS (填写时开头不带 HTTP 末尾不带 "/" ),该服务下所有API都使用此域名</div>
		</div>

		<div class="panel-group" id="accordion">
			<div class="panel panel-default">
				<div class="panel-heading">
					<h4 class="panel-title">
              <a data-toggle="collapse" data-parent="#accordion" href="#collapseOne">
                  高级设置
              </a>
            </h4>
				</div>
				<div id="collapseOne" class="panel-collapse collapse">

					<div class="column">
						<div class="field">超时时间:</div>
						<input name="service_timeout" id="service_timeout" class="kt1 fl _service_timeout _blur_num_rz" value="3000" autocomplete="on" maxlength="50" placeholder="3000" style="width: 100px" />
						<div class="commentaryt">毫秒（建议不超过5000毫秒）</div>
						<div id="service_timeout_id" class="error hide">
							<i></i><span id="service_timeout_msg"></span>
						</div>
						<div class="cls"></div>
					</div>
					<div class="column">
						<div class="fieldt fl">Request Headers:</div>
						<div class="commentaryt">（http 响应开头，非必填）</div>
						<div class="cls"></div>
					</div>
					<div class="column">
						<div class="table-top">
							<div class="tab">参数</div>
							<div class="tab">值</div>
						</div>

						<!-- 循环 -->
						<div jput="jput_format_request" jput-jsondata='[]'>
							<div class="_raw_request_head">
								<div class="table-foot fl">
									<div class="tab">
										<input name="request['name']" id="name1" class="kt5" onblur="javascript:checkValue(this);return false;" onfocus="javascript:rmError(this);return false;" autocomplete="on" maxlength="50" />
									</div>
									<div class="tab">
										<input name="request['value']" id="email1" class="kt5" autocomplete="on" />
									</div>
								</div>
								<div class="commentaryy">
									<a href="javascript:void(0)" class="_request_head_del">删除</a>
								</div>
							</div>
						</div>
						<!-- 循环 -->

					</div>

					<div class="cls"></div>
					<div class="column" style="height: 50px; margin-top: 16px">
						<a href="javascript:void(0)" id="save1" class="cobed _add_request_headers" title="继续添加">继续添加</a> <input type="hidden" value="" class="_request_headers_json" />
					</div>

					<div class="column">
						<div class="fieldt fl">Response Headers:</div>
						<div class="commentaryt">（ http 响应开头，非必填）</div>
						<div class="cls"></div>
					</div>
					<div class="column">
						<div class="table-top">
							<div class="tab">参数</div>
							<div class="tab">值</div>
						</div>

						<!-- 循环 -->
						<div jput="jput_format_response" jput-jsondata='[]'>
							<div class="_raw_response_head">
								<div class="table-foot fl">
									<div class="tab">
										<input name="response['param']" id="name2" class="kt5" onblur="javascript:checkValue(this);return false;" onfocus="javascript:rmError(this);return false;" autocomplete="on" maxlength="50" />
									</div>
									<div class="tab">
										<input name="response['value']" id="email2" class="kt5" autocomplete="on" />
									</div>
								</div>
								<div class="commentaryy">
									<a href="javascript:void(0)" class="_response_head_del">删除</a>
								</div>
							</div>
						</div>
						<!-- 循环 -->

					</div>
					<div class="cls"></div>
					<div class="column" style="height: 50px; margin-top: 16px">
						<a href="javascript:void(0)" id="save2" class="cobed _add_response_headers" title="继续添加">继续添加</a>
						<input type="hidden" value="" class="_response_headers_json" />
					</div>

				</div>
			</div>
		</div>

		<div class="column">
			<button type="button" class="confirm _add_confirm" data-id="list" id="register" style="margin-right: 10px">发布服务</button>
			<button type="button" class="confirm _add_confirm" data-id="add_api" id="register_api">保存,并添加API</button>
			<div class="cls"></div>
		</div>
	</div>
</div>
</div>
<input type="hidden" value='{$json_category_string}' class='_categoryObj' />
</body>

<script src="__PUBLIC__/home/js/jquery.1.11.min.js"></script>
<script src="__PUBLIC__/home/js/bootstrap.min.js"></script>
<script src="__PUBLIC__/home/js/uploads_pic/cropper.min.js"></script>
<script src="__PUBLIC__/home/js/uploads_pic/main.js"></script>
<script src="__PUBLIC__/js/jquery.selectlist.js"></script>
<script src="__PUBLIC__/js/common.js"></script>
<script src="__PUBLIC__/home/js/jput-2.js"></script>
<script src="__PUBLIC__/home/js/serviceadd.js"></script>
<script src="__PUBLIC__/home/js/serviceapi_common.js"></script>
<script src="__PUBLIC__/home/js/waitMe.js"></script>

</html>